﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="ApplicationPages.aspx.cs" Inherits="Cms.Web.UI.Admin.ApplicationPages" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="Stylesheet" href="Admin/Css/Explorer.css" type="text/css" />
    <link rel="Stylesheet" href="Admin/Css/List.css" type="text/css" />
    <script language="javascript">
        //<![CDATA[
        function initPageList() {
            cms.Lists.Init("pagePane", preparePagePopup);
        }

        function preparePagePopup(trigger, id, e) {
            var popup = document.getElementById("pnlPagePopup");
            var hlEditPageBasicProperties = document.getElementById("hlEditPageBasicProperties");
            var hlEditPageLocalizedProperties = document.getElementById("hlEditPageLocalizedProperties");
            var hlEditPageDesign = document.getElementById("hlEditPageDesign");
            var hlEditPageCode = document.getElementById("hlEditPageCode");
            var hlEditPageContent = document.getElementById("hlEditPageContent");
            if (id.substring(0, 1) == "P") {
                hlEditPageBasicProperties.href = "Admin/EditPage.aspx?tab=basicproperties&id=" + id.substring(1);
                hlEditPageLocalizedProperties.href = "Admin/EditPage.aspx?tab=localizedproperties&id=" + id.substring(1);
                hlEditPageContent.href = "Admin/EditPage.aspx?tab=content&id=" + id.substring(1);
                hlEditPageDesign.style.display = "none";
                hlEditPageCode.style.display = "none";
            }
            else {
                hlEditPageBasicProperties.href = "Admin/EditApplicationPage.aspx?tab=basicproperties&id=" + id.substring(1);
                hlEditPageLocalizedProperties.href = "Admin/EditApplicationPage.aspx?tab=localizedproperties&id=" + id.substring(1);
                hlEditPageDesign.href = "Admin/EditApplicationPage.aspx?tab=design&id=" + id.substring(1);
                hlEditPageCode.href = "Admin/EditApplicationPage.aspx?tab=code&id=" + id.substring(1);
                hlEditPageContent.href = "Admin/EditApplicationPage.aspx?tab=content&id=" + id.substring(1);
                hlEditPageDesign.style.display = "";
                hlEditPageCode.style.display = "";
            }
            document.getElementById("ctl00_body_hidSelectedPageID").value = id;
            cms.Lists.ShowPopup(popup, trigger, "left", 0, 0, true, e);
        }
        //]]>
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="buttons" runat="server">
    <asp:hyperlink ID="hlNewPage" runat="server" CssClass="orangeButton"><span><span><img src="Admin/Img/icons/page_code_add.png" alt="" /><span><cms:LocalizedLiteral ID="llNewPage" runat="server" /></span></span></span></asp:hyperlink>
    <asp:hyperlink ID="hlBack" runat="server" CssClass="orangeButton"><span><span><img src="Admin/Img/icons/arrow_undo.png" alt="" /><span><cms:LocalizedLiteral ID="llBack" runat="server" /></span></span></span></asp:hyperlink>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="body" runat="server">
    <asp:Literal ID="litIcon" runat="server" Visible="false" Text="Admin/Img/Icons/page_code.png" />
    <div id="pagePane">
        <asp:UpdatePanel ID="upnlPages" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
            <ContentTemplate>
                <asp:Panel ID="pnlPageActions" runat="server" />
                <table>
                    <tr>
                        <th><cms:LocalizedLiteral ID="llNameHeader" runat="server" /></th>
                        <th><cms:LocalizedLiteral ID="llFilenameHeader" runat="server" /></th>
                    </tr>
                    <asp:Repeater ID="rpPages" runat="server" OnItemDataBound="rpPages_ItemDataBound">
                        <ItemTemplate>
                            <tr>
                                <td><asp:Literal ID="litID" runat="server" /><img id="imgPage" runat="server" /><span><asp:literal ID="litName" runat="server" /></span></span></td>
                                <td><asp:Literal ID="litFilename" runat="server" /></td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
                <asp:Panel ID="pnlNoPages" runat="server" class="noListRows"><cms:LocalizedLiteral ID="llNoPages" runat="server" /></asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
        <div id="pagePaneOverlay" class="paneOverlay"></div>
        <div id="pagePaneOverlayProgress" class="paneOverlayProgress"><img src="Admin/img/progress.gif" /></div>
    </div>
    <asp:UpdatePanel ID="upnlActions" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
        <ContentTemplate>
            <div id="pnlPagePopup" class="popup">
                <div class="popupMenuTop">
                    <div class="popupMenuTopBg">&nbsp;</div>
                    <div class="popupMenuTopLeftCorner">&nbsp;</div>
                    <div class="popupMenuTopRightCorner">&nbsp;</div>
                </div>
                <div class="popupMenu">
                    <div class="popupMenuLeftBg">&nbsp;</div>
                    <div class="popupMenuRightBg">&nbsp;</div>
                    <div class="popupMenuContent">
                        <asp:LinkButton id="lbPreviewPage" runat="server" OnClick="lbPreviewPage_Click" OnClientClick="cms.Lists.ShowPaneOverlay('pagePaneOverlay');"><img id="imgPreviewPage" runat="server" src="Admin/Img/icons/page_magnify.png" /><span id="lblPreviewPage" runat="server"><cms:LocalizedLiteral ID="llPreviewPage" runat="server" /></span></asp:LinkButton>
                        <a id="hlEditPageContent" href="#"><img src="Admin/Img/icons/page_white_edit.png" /><span><cms:LocalizedLiteral ID="llEditPageContent" runat="server" /></span></a>
                        <a id="hlEditPageLocalizedProperties" href="#"><img src="Admin/Img/icons/page_world.png" /><span><cms:LocalizedLiteral ID="llEditPageLocalizedProperties" runat="server" /></span></a>
                        <a id="hlEditPageDesign" href="#"><img src="Admin/Img/icons/page_code.png" /><span><cms:LocalizedLiteral ID="llEditPageDesign" runat="server" /></span></a>
                        <a id="hlEditPageCode" href="#"><img src="Admin/Img/icons/page_white_csharp.png" /><span><cms:LocalizedLiteral ID="llEditPageCode" runat="server" /></span></a>
                        <a id="hlEditPageBasicProperties" href="#"><img src="Admin/Img/icons/page_gear.png" /><span><cms:LocalizedLiteral ID="llEditPageBasicProperties" runat="server" /></span></a>
                        <div class="horizontalDivider" style="margin-bottom: 3px; margin-top: 4px; margin-left: 27px; margin-right: 4px;"></div>
                        <asp:LinkButton ID="lbDeletePage" runat="server" OnClick="lbDeletePage_Click" OnClientClick="cms.Lists.ShowPaneOverlay('pagePaneOverlay');"><img id="imgDeleteFile" runat="server" src="Admin/Img/icons/cross.png" /><span id="lblDeleteFile" runat="server"><cms:LocalizedLiteral ID="llDeletePage" runat="server" /></span></asp:LinkButton>
                    </div>
                </div>
                <div class="popupMenuBottom">
                    <div class="popupMenuBottomBg">&nbsp;</div>
                    <div class="popupMenuBottomLeftCorner">&nbsp;</div>
                    <div class="popupMenuBottomRightCorner">&nbsp;</div>
                </div>
            </div>
            <input type="hidden" id="hidSelectedPageID" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <script language="javascript">
        //<![CDATA[
        iLib.Dom.AddListener(window, "load", initPageList);
        cms.Ajax.Init();
        cms.Ajax.AddEndRequestHandler(cms.Lists.HidePaneOverlays);
        //]]>
    </script>
</asp:Content>
